<template>
	<view class="">

	</view>
</template>

<script setup>
	import {
		onShow,
		onLoad,
		onHide
	} from "@dcloudio/uni-app"
	import useI18n from '@/store/useI18n.js'
	const {
		t
	} = useI18n()
	import common from '../../js/common';

	onShow(function() {

		if (getApp().globalData.taburl && getApp().globalData.taburl != "") {
			uni.switchTab({
				url: getApp().globalData.taburl
			})
		} else {
			uni.switchTab({
				url: "/pages/index/index"
			})
		}
		setTimeout(function() {
			uni.navigateTo({
				url: "/pages/index/tx?v=1"
			})
		}, 100)

		updateTabBarTexts()
	})
	// 初始化菜单名称
	const updateTabBarTexts = () => {

		const tabMap = {
			0: 'menu1',
			1: 'menu2',
			2: 'menu3',
			3: 'menu4',
			4: 'menu5'
		}
		Object.entries(tabMap).forEach(([index, key]) => {
			uni.setTabBarItem({
				index: parseInt(index),
				text: t(key)
			})
		})
	}
</script>

<style scoped lang="scss">

</style>